package com.cyz.web.app.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

@Slf4j
public class Client {

    public static void main(String[] args) {

        ApplicationContext applicationContext = new AnnotationConfigApplicationContext(ExtConfig.class);

        applicationContext.publishEvent(new ApplicationEvent("zhangsan") {
            @Override
            public Object getSource() {
                return super.getSource();
            }
        });

        ((AnnotationConfigApplicationContext)applicationContext).close();

    }

}
